package nonfixcycle

import (
	"blockchain/public/entity"
)

func reply(round int){
	for i:=range primarysSeq{
		<-FlagReplied[primarysSeq[i]]
		FlagReplied[primarysSeq[i]]=make(chan bool,1)
	}
	close(chanReply)
	var block entity.Block
	for data:=range chanReply{
		block=data.block
	}
	chanReply=make(chan commit2Message,K)
	blockchain[round]=block
	//fmt.Println(block)
}

func reply1(round int){
	for i:=range primarysSeq{
		<-FlagReplied_1[primarysSeq[i]]
		FlagReplied_1[primarysSeq[i]]=make(chan bool,1)
	}
	close(chanReply_1)
	var block entity.Block
	for data:=range chanReply_1{
		block=data.block
	}
	chanReply_1=make(chan commit2Message,K)
	blockchain[round]=block
	//fmt.Println(block)
}
